package com.kinglong.demo.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.kinglong.demo.mapper.UserMapper;
import com.kinglong.demo.model.User;
import com.kinglong.demo.model.UserVo;
import com.kinglong.demo.service.UserService;

/**
 * @author jyangzi5
 * @version 1.0
 * @description: TODO
 * @date 2021/4/19 11:22
 */
@Service
public class UserServiceImpl implements UserService {
	@Autowired
	private UserMapper userMapper;

	@Override
	public int saveUser(User user) {
		user.setId(System.currentTimeMillis());
		return userMapper.saveUser(user);
	}

	@Override
	public void deleteUser(String[] ids) {
		userMapper.deleteUser(ids);
	}

	@Override
	public void modifyUser(User user) {
		userMapper.modifyUser(user);
	}

	@Override
	public List<User> getUserList(UserVo user) {
		return userMapper.getUserList(user);
	}

	@Override
	public int getUserCount(UserVo user) {
		return userMapper.getUserCount(user);
	}

	@Override
	public User getUserById(Long id) {
		return userMapper.getUserById(id);
	}
}
